package com.jianbing.util;

import com.google.common.collect.Interner;
import com.google.common.collect.Interners;
import com.sun.org.apache.xpath.internal.operations.Number;

/**
 * Created by Han, Tixiang on 2016/11/8 0008.
 */
public class StringPoolUtils {

    private static final Interner<String> pool = Interners.newWeakInterner();


    private static Interner<String> getPool() {
        return pool;
    }

    public static String getPoolString(String source) {
        return getPool().intern(source);
    }

    public static String getPoolString(Number id) {
        return getPool().intern(id + "");
    }

    public static String getPoolString(int id) {
        return getPool().intern(id + "");
    }
}
